home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK2.toast / Development Kits (Disc 2) / QuickTime / Programming Stuff / Documentation / develop articles / develop Issue 23 / Internet Config / IC 1.1 / ICAppSourceKit1.1 / InternetConfig.p < prev    next >
Encoding:
Text File  |  1997-02-26  |  1.5 KB  |  68 lines  |  [TEXT/PJMM]

  1. program InternetConfig;
  2.  
  3.     uses
  4.         RequiredEventSupport,{}
  5.         ICGlobals, ICDocument, ICEvents, ICWindows, ICInstall, ICIconSuites, ICMiscSubs, ICEditPrefAppleEvents;
  6.  
  7.     procedure HandleAppParams;
  8.         var
  9.             ap_file: AppFile;
  10.             fss: FSSpec;
  11.             msg, count: integer;
  12.             junk: OSErr;
  13.             err: OSErr;
  14.             junklong: longint;
  15.     begin
  16.         if has_AppleEvents then begin
  17.             junk := InitAppleEvents(@DoOpenApp, @DoOpenDoc, nil, @DoQuit);
  18.         end
  19.         else begin
  20.             CountAppFiles(msg, count);
  21.             if count <= 0 then begin
  22.                 DisplayError(acNewDocument, DoOpenApp);
  23.             end
  24.             else begin
  25.                 GetAppFiles(1, ap_file);
  26.                 ClrAppFiles(1);
  27.                 if GetWDInfo(ap_file.vRefNum, fss.vRefNum, fss.parID, junklong) = noErr then begin
  28.                     fss.name := ap_file.fName;
  29.                     DisplayError(acOpenDocument, DoOpenDoc(fss));
  30.                 end; (* if *)
  31.             end; (* if *)
  32.         end; (* if *)
  33.     end; (* HandleAppParams *)
  34.  
  35.     var
  36.         mbar: Handle;
  37.         err: OSErr;
  38.         junk: OSErr;
  39. begin
  40.     mbar := GetNewMBar(128);
  41.     if mbar = nil then begin
  42.         ExitToShell;
  43.     end; (* if *)
  44.     SetMenuBar(mbar);
  45.     AddResMenu(GetMHandle(M_Apple), 'DRVR');
  46.     DrawMenuBar;
  47.     InitGlobals;
  48.     InitMiscSubs;
  49.     InitICIconSuites;
  50.     err := InitICWindows;
  51.     if err = noErr then begin
  52.         err := InitializeComponentInstallation;
  53.     end; (* if *)
  54.     if err = noErr then begin
  55.         err := InitICDocument;
  56.     end; (* if *)
  57.     if err <> noErr then begin
  58.         DisplayError(acStartApplication, err);
  59.         ExitToShell;
  60.     end; (* if *)
  61.     HandleAppParams;
  62.     SetupEditPrefAppleEvent;
  63.     InitCursor;
  64.     while not quitnow do begin
  65.         HandleEvents;
  66.     end; (* while *)
  67.     TermICDocument;
  68. end. (* InternetConfig *)